home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Printer / djf_for_3.0 / table.h < prev   
Text File  |  1992-10-18  |  5KB  |  172 lines

  1. /*
  2.  * Mach Operating System
  3.  * Copyright (c) 1986 Carnegie-Mellon University
  4.  * All rights reserved.  The CMU software License Agreement specifies
  5.  * the terms and conditions for use and redistribution.
  6.  */
  7. /*
  8.  * HISTORY
  9.  * 25-Oct-88  Gregg Kellogg (gk) at NeXT, Inc.
  10.  *    Added    TBL_MACHFACTOR
  11.  *        TBL_DISKINFO
  12.  *        TBL_CPUINFO
  13.  *        TBL_IOINFO
  14.  *        TBL_DISKINFO
  15.  *        TBL_NETINFO
  16.  *
  17.  * 15-Mar-88  David Golub (dbg) at Carnegie-Mellon University
  18.  *    Added TBL_PROCINFO (MACH only).
  19.  *
  20.  * 15-Apr-87  Mike Accetta (mja) at Carnegie-Mellon University
  21.  *    Added TBL_LOADAVG.
  22.  *    [ V5.1(F8) ]
  23.  *
  24.  *  7-Nov-86  David Golub (dbg) at Carnegie-Mellon University
  25.  *    Added TBL_ARGUMENTS, also for MACH_VM only.
  26.  *
  27.  * 24-Jul-86  David Golub (dbg) at Carnegie-Mellon University
  28.  *    Added TBL_UAREA.  For now it only works under MACH virtual
  29.  *    memory.
  30.  *
  31.  * 24-Jul-86  Mike Accetta (mja) at Carnegie-Mellon University
  32.  *    Added TBL_INCLUDE_VERSION and TBL_FSPARAM.
  33.  *
  34.  * 30-Aug-85  Mike Accetta (mja) at Carnegie-Mellon University
  35.  *    Added TBL_U_TTYD.
  36.  *    [V1(1)]
  37.  *
  38.  * 30-Mar-83  Mike Accetta (mja) at Carnegie-Mellon University
  39.  *    Created (V3.06h).
  40.  */
  41.  
  42. #import <sys/dk.h>
  43. #import <machine/table.h>
  44.  
  45. #define    TBL_TTYLOC        0    /* index by device number */
  46. #define    TBL_U_TTYD        1    /* index by process ID */
  47. #define    TBL_UAREA        2    /* index by process ID */
  48. #define    TBL_LOADAVG        3    /* (no index) */
  49. #define    TBL_INCLUDE_VERSION    4    /* (no index) */
  50. #define    TBL_FSPARAM        5    /* index by device number */
  51. #define    TBL_ARGUMENTS        6    /* index by process ID */
  52. #define    TBL_PROCINFO        10    /* index by proc table slot */
  53. #define    TBL_MACHFACTOR        11    /* index by cpu number */
  54. #define TBL_CPUINFO        12    /* (no index), generic CPU info */
  55. #define TBL_IOINFO        13    /* (no index), generic I/O info */
  56. #define    TBL_DISKINFO        14    /* indexed by dk slot */
  57. #define TBL_NETINFO        15    /* index by network slot */
  58.  
  59. /*
  60.  * Machine specific table id base
  61.  */
  62. #define TBL_MACHDEP_BASE    0x4000    /* Machine dependent codes start here */
  63.  
  64. /*
  65.  * Return codes from machine dependent calls
  66.  */
  67. #define TBL_MACHDEP_NONE    0    /* Not handled by machdep code */
  68. #define    TBL_MACHDEP_OKAY    1    /* Handled by machdep code */
  69. #define    TBL_MACHDEP_BAD        -1    /* Bad status from machdep code */
  70.  
  71. /*
  72.  *  TBL_FSPARAM data layout
  73.  */
  74. struct tbl_fsparam
  75. {
  76.     long tf_used;        /* free fragments */
  77.     long tf_iused;        /* free inodes */
  78.     long tf_size;        /* total fragments */
  79.     long tf_isize;        /* total inodes */
  80. };
  81.  
  82. /*
  83.  *  TBL_LOADAVG data layout
  84.  *  (used by TBL_MACHFACTOR too)
  85.  */
  86. struct tbl_loadavg
  87. {
  88.     long   tl_avenrun[3];
  89.     int    tl_lscale;        /* 0 scale when floating point */
  90. };
  91.  
  92. /*
  93.  *    TBL_PROCINFO data layout
  94.  */
  95. #define    PI_COMLEN    19    /* length of command string */
  96. struct tbl_procinfo
  97. {
  98.     int        pi_uid;        /* user ID */
  99.     int        pi_pid;        /* proc ID */
  100.     int        pi_ppid;    /* parent proc ID */
  101.     int        pi_pgrp;    /* proc group ID */
  102.     int        pi_ttyd;    /* controlling terminal number */
  103.     int        pi_status;    /* process status: */
  104. #define    PI_EMPTY    0        /* no process */
  105. #define    PI_ACTIVE    1        /* active process */
  106. #define    PI_EXITING    2        /* exiting */
  107. #define    PI_ZOMBIE    3        /* zombie */
  108.     int        pi_flag;    /* other random flags */
  109.     char    pi_comm[PI_COMLEN+1];
  110.                 /* short command name */
  111. };
  112.  
  113. /*
  114.  * TBL_CPUINFO data layout
  115.  */
  116. struct tbl_cpuinfo
  117. {
  118.     int        ci_swtch;        /* # context switches */
  119.     int        ci_intr;        /* # interrupts */
  120.     int        ci_syscall;        /* # system calls */
  121.     int        ci_traps;        /* # system traps */
  122.     int        ci_hz;            /* # ticks per second */
  123.     int        ci_phz;            /* profiling hz */
  124.     int        ci_cptime[CPUSTATES];    /* cpu state times */
  125. };
  126.  
  127. /*
  128.  * TBL_IOINFO data layout
  129.  */
  130. struct tbl_ioinfo
  131. {
  132.     int        io_ttin;    /* # bytes of tty input */
  133.     int        io_ttout;    /* # bytes of tty output */
  134.     int        io_dkbusy;    /* drives active? */
  135.     int        io_ndrive;    /* number disk drives configured */
  136.     int        io_nif;        /* number of network interfaces */
  137. };
  138.  
  139. /*
  140.  * TBL_DISKINFO data layout (not generically implemented)
  141.  */
  142. struct tbl_diskinfo
  143. {
  144.     int        di_time;    /* ticks drive active */
  145.     int        di_seek;    /* # drive seeks */
  146.     int        di_xfer;    /* # drive transfers */
  147.     int        di_wds;        /* # sectors transfered */
  148.     int        di_bps;        /* drive transfer rate (bytes per second) */
  149.     char    di_name[8];    /* drive name */
  150. };
  151.  
  152. /*
  153.  * TBL_NETINFO data layout
  154.  */
  155. struct tbl_netinfo
  156. {
  157.     int        ni_ipackets;    /* # input packets */
  158.     int        ni_ierrors;    /* # input errors */
  159.     int        ni_opackets;    /* # output packets */
  160.     int        ni_oerrors;    /* # output errors */
  161.     int        ni_collisions;    /* # # collisions on csma if's */
  162.     char    ni_name[8];    /* interface name */
  163. };
  164.  
  165. #ifdef KERNEL
  166. /*
  167.  * Machine specific procedure prototypes.
  168.  */
  169. int machine_table(int id, int index, caddr_t addr, int nel, u_int lel, int set);
  170. int machine_table_setokay(int id);
  171. #endif KERNEL
  172.